home *** CD-ROM | disk | FTP | other *** search
/ PCNet 2000 November / PCnet Mega CD - Kasım 2000.iso / HTML / CLIP / Bullets / GIFView.jar / WGClasses / GIFView.class (.txt) next >
Encoding:
Java Class File  |  1998-04-28  |  1.8 KB  |  51 lines

  1. package WGClasses;
  2.  
  3. import java.applet.Applet;
  4. import java.awt.Color;
  5. import java.awt.Component;
  6. import java.awt.Container;
  7. import java.awt.Dimension;
  8. import java.awt.Image;
  9. import java.awt.LayoutManager;
  10. import java.awt.event.MouseEvent;
  11. import java.net.MalformedURLException;
  12. import java.net.URL;
  13.  
  14. public class GIFView extends Applet {
  15.    // $FF: renamed from: iv WGClasses.ImageView2
  16.    ImageView2 field_0;
  17.    String imgFName;
  18.    String linkFName;
  19.  
  20.    public void init() {
  21.       ((Container)this).setLayout((LayoutManager)null);
  22.       ((Component)this).setBackground(Color.white);
  23.       Dimension var1 = ((Component)this).getSize();
  24.       this.field_0 = new ImageView2();
  25.       this.field_0.setBounds(0, 0, var1.width, var1.height);
  26.       ((Container)this).add(this.field_0);
  27.       this.imgFName = ((Applet)this).getParameter("ImageURL");
  28.       this.linkFName = ((Applet)this).getParameter("LinkURL");
  29.  
  30.       try {
  31.          Image var2 = this.field_0.getToolkit().getImage(new URL(((Applet)this).getDocumentBase(), this.imgFName));
  32.          this.field_0.setViewedImage(var2);
  33.       } catch (MalformedURLException var3) {
  34.       }
  35.  
  36.       MyMouseEvent var4 = new MyMouseEvent(this);
  37.       this.field_0.addMouseListener(var4);
  38.    }
  39.  
  40.    public void destroy() {
  41.       this.field_0.setViewedImage((Image)null);
  42.    }
  43.  
  44.    void GIFView_MouseClick(MouseEvent var1) {
  45.       try {
  46.          ((Applet)this).getAppletContext().showDocument(new URL(((Applet)this).getDocumentBase(), this.linkFName));
  47.       } catch (MalformedURLException var2) {
  48.       }
  49.    }
  50. }
  51.